#pragma once

#include "geometry.h"

namespace kp {

	struct Intersection;

	// Texture Declarations
	class TextureMapping2D {
	public:
		// TextureMapping2D Interface
		virtual ~TextureMapping2D() {}
		virtual Point2f Map(const Intersection& si) const = 0;
	};

	class UVMapping2D : public TextureMapping2D {
	public:
		UVMapping2D() {}
		virtual Point2f Map(const Intersection& si) const override {
			return Point2f();
		}
	};

	template <typename T>
	class Texture {
	public:
		virtual T evaluate(const Intersection& isct) const = 0;
	};

	class UVTexture : public Texture<Spectrum> {
	public:
		virtual Spectrum evaluate(const Intersection& isct) const;
	};

	class ConstantTexture : public Texture<Spectrum> {
	public:
		ConstantTexture(Spectrum color):color(color) {}
		virtual Spectrum evaluate(const Intersection& isct) const { return color; }
	private:
		Spectrum color;
	};

}
